const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('djg_zhanghao', {
    belongxiaqucode: {
      type: DataTypes.STRING(150),
      allowNull: true,
      field: 'BELONGXIAQUCODE'
    },
    operateusername: {
      type: DataTypes.STRING(150),
      allowNull: true,
      field: 'OPERATEUSERNAME'
    },
    rowId: {
      type: DataTypes.BIGINT,
      allowNull: true,
      field: 'ROW_ID'
    },
    yearflag: {
      type: DataTypes.STRING(24),
      allowNull: true,
      field: 'YEARFLAG'
    },
    rowguid: {
      type: DataTypes.STRING(50),
      allowNull: false,
      primaryKey: true,
      field: 'ROWGUID'
    },
    operatedate: {
      type: DataTypes.DATE,
      allowNull: true,
      field: 'OPERATEDATE'
    },
    userguid: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'USERGUID'
    },
    username: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'USERNAME'
    },
    danweiname: {
      type: DataTypes.STRING(500),
      allowNull: true,
      field: 'DANWEINAME'
    },
    danweiguid: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'DANWEIGUID'
    },
    auditstatus: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'AUDITSTATUS'
    },
    createrName: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'CREATER_NAME'
    },
    createrGuid: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'CREATER_GUID'
    },
    createtype: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'CREATETYPE'
    },
    email: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'EMAIL'
    },
    comaddress: {
      type: DataTypes.STRING(200),
      allowNull: true,
      field: 'COMADDRESS'
    },
    comzip: {
      type: DataTypes.STRING(20),
      allowNull: true,
      field: 'COMZIP'
    },
    companyphone: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'COMPANYPHONE'
    },
    passwd: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'PASSWD'
    },
    statuscode: {
      type: DataTypes.STRING(20),
      allowNull: true,
      field: 'STATUSCODE'
    },
    loginid: {
      type: DataTypes.STRING(50),
      allowNull: true
    },
    createrDate: {
      type: DataTypes.DATE,
      allowNull: true,
      field: 'CREATER_DATE'
    },
    idcard: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'IDCARD'
    },
    mobilephone: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'MOBILEPHONE'
    },
    xiaqucode: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'XIAQUCODE'
    },
    xiaquname: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'XIAQUNAME'
    },
    displayname: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'DISPLAYNAME'
    },
    socialcode: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'SOCIALCODE'
    },
    usertype: {
      type: DataTypes.STRING(500),
      allowNull: true,
      field: 'USERTYPE'
    },
    isenabled: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'ISENABLED'
    },
    adddate: {
      type: DataTypes.DATE,
      allowNull: false,
      defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP')
    }
  }, {
    sequelize,
    tableName: 'djg_zhanghao',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "ROWGUID" },
        ]
      },
      {
        name: "idx_DANWEIGUID",
        using: "BTREE",
        fields: [
          { name: "DANWEIGUID" },
        ]
      },
    ]
  });
};
